<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>stapes例子12</title>
    <script type="text/javascript" src="../lib/stapes-0.8.1/stapes.js"></script>
    <script type="text/javascript" src="../lib/jquery-easyui-1.4.2/jquery.min.js"></script>
</head>
<body>
<h1>你好!!!</h1>

<div id="app">11111</div>


<script type="text/javascript">
    var Module = Stapes.subclass({
        constructor : function(name) {
            this.name = name;
        },

        beReady : function() {
            this.emit('ready');
        }
    });

    var module1 = new Module('module1');
    var module2 = new Module('module2');

    Stapes.on('ready', function(data, e) {
        console.log('a ready event was triggered in: ' + e.scope.name);
    });

    module1.beReady(); // 'a ready event was triggered in module 1';
    module2.beReady(); // 'a ready event was triggered in module 2';

</script>


</body>
</html>